package com.example.ccjml;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;

import androidx.activity.EdgeToEdge;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.example.ccj.b.a.BaseActivity;
import com.example.ccj.b.c.custom.file.FileAdapterListener;
import com.example.ccj.b.c.custom.file.FileMode;
import com.example.ccj.b.c.custom.file.FileNetworkAddListener;
import com.example.ccj.b.c.custom.file.FileNetworkDeleteListener;
import com.example.ccj.b.c.custom.file.FilePickControl;
import com.example.ccj.u.LogUtils;

public class FilePickActivity extends BaseActivity {

    @Override
    public void initData(@Nullable Bundle bundle) {

    }

    @Override
    public void initView(@Nullable Bundle savedInstanceState, @Nullable View contentView) {
        FilePickControl filePickControl = findViewById(R.id.file_pick);

        filePickControl.getTitleBarOnDisplayControl().getTvTitleView().setTextSize(13);
        filePickControl.getTitleBarOnDisplayControl().getTvLeftTag().setBackgroundColor(Color.RED);

        filePickControl.setLoadMode(FilePickControl.LOCAL)
                .setMaxSum(2)
                .setTagText("测试提示")
                .setTitleName("文件选择")
                .setFileAdapterListener(new FileAdapterListener() {
                    @Override
                    public void onDelete(FileMode fileMode, FileNetworkDeleteListener fileNetworkDeleteListener) {
                        LogUtils.d("删除文件回调" + fileMode.path + fileNetworkDeleteListener);
                    }

                    @Override
                    public void onAdd(FileMode fileMode, FileNetworkAddListener fileNetworkChangeListener) {
                        LogUtils.d("添加文件回调" + fileMode.path + fileNetworkChangeListener);
                    }
                }).builder();
    }

    @Override
    public int initContentView() {
        return R.layout.activity_file_pick;
    }
}